package dbutils;


import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 * Created by IntelliJ IDEA.
 * User: alex
 * Date: 09.04.2011
 * Time: 17:19:16
 * To change this template use File | Settings | File Templates.
 */
public class HandleConnections {

    public static void main(String[] args) throws Exception {
        Connection con = DbUtils.getDBConnectionGeneral();
        con.setAutoCommit(false);
        Statement statement = con.createStatement(
                ResultSet.TYPE_SCROLL_INSENSITIVE,
                ResultSet.CONCUR_UPDATABLE);

        ResultSet rs = statement.executeQuery("SELECT * FROM dic_units where unit = 'DIC_INCREASING_DECREASING'");
//        System.out.println("con: " + con.hashCode());
        rs.next();
        rs.updateString(1, "alex");
//        con.rollback();
        con.commit();


//        ps.close();
        con.close();
    }
}
